package com.pioneer.controller.stock;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.pioneer.common.core.controller.BaseController;
import com.pioneer.common.core.domain.AjaxResult;
import com.pioneer.web.stock.domain.StoOnhand;
import com.pioneer.web.stock.service.IStoOnhandService;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 现存量
 *
 * @author hlm
 */
@RestController
@RequestMapping("/stock/onhand")
public class StoOnhandController extends BaseController {

    @Resource
    private IStoOnhandService onhandService;

    /**
     * 获取现存量列表
     *
     * @param onhand 查询条件
     * @return 结果
     */
    @PreAuthorize("@ss.hasPerm('stock:onhand:list')")
    @GetMapping("/list")
    public AjaxResult list(StoOnhand onhand) {
        boolean isPage = startPage();
        List<Map<String, Object>> list = onhandService.selectOnhandList(onhand);
        return success(isPage, list);
    }
}
